import React, { Component } from 'react'

import AraleQRCode from "arale-qrcode"
// 封装高阶组件
export default (Component) => {
    class NewComponent extends Component {
        state = {

        }

        componentDidMount() {
            let codeFigure = new AraleQRCode({
                "render": "svg", // 生成的类型 "svg" "table"
                "text": "https://img2.baidu.com/it/u=2619035048,309590331&fm=26&fmt=auto&gp=0.jpg",//需要生成二维码的链接
                "size": 120 //生成二维码大小
            });
            let share_tools = document.querySelector('#share_tools');
            share_tools.appendChild(codeFigure)
        }
        render() {
            return <Component />
        }
    }

    return NewComponent
}